//在这个JS文件中，专门用来创建 Store 的实例对象
import {action, observable} from 'mobx-miniprogram'
 
export const store = observable({
    active: 0,
    checkNum: 0,
    icon: [{
      normal: '../../image/tabbar/home.png',
      active: '../../image/tabbar/home_act.png',
    },{
      normal: '../../image/tabbar/list.png',
      active: '../../image/tabbar/list_act.png',
    },{
      normal: '../../image/tabbar/cart.png',
      active: '../../image/tabbar/cart_act.png',
    },{
      normal: '../../image/tabbar/user.png',
      active: '../../image/tabbar/user_act.png',
    }],
    // 计算属性
    get sum(){
      
    },
    // actions 方式，用来修改store中的数据
    updataActive: action(function(step){
      this.active = step
    }),
    updateCheckNum: action(function(res){
      this.checkNum = res
    })
  
})